﻿@using Common
@using Web.Helper
@model Common.PagedList<Models.UserModels.Knowledge>
<div>

    <blockquote class="col-lg-2 ">
        <h3>知识库 @Ajax.ActionLink("+", "Create", null, new AjaxOptions() { UpdateTargetId = "Main" }, new { @class = "btn" })</h3>
    </blockquote>

    <div class=" col-xs-3  pull-right">
        @Html.Partial("Search_Input")
    </div>

</div>
<div class="clearfix"></div>
<div>
    @foreach (var item in Model)
    {
        <blockquote>
            <span class="pull-right">
                @if (item.UserId.Equals(ViewBag.UserId))
                {
                    <span>&nbsp;</span>
                    //如果是我发起的我可以编辑
                    @Ajax.ActionLink(lang.Edit, "Edit", null, new { id = item.Id }, new AjaxOptions { UpdateTargetId = "Main" }, new { @class = "btn btn-small btn-info" })
                    <span>&nbsp;</span>
                    //如果是我发起的我可以删除
                    @Ajax.ActionLink(lang.Delete, "Delete", null, new { id = item.Id }, new AjaxOptions { UpdateTargetId = "Main", HttpMethod = "Delete", Confirm = "您确定要删除该记录吗？该操作不可恢复！" }, new { @class = "btn btn-small btn-danger" })
                }
            </span>
            <p>
                @if (!item.Public)
                {
                    <i class="fa fa-lock"></i>
                }
                @Ajax.ActionLink(item.KnowledgeTitle, "Details", new { item.Id }, new AjaxOptions { UpdateTargetId = "Main" })
            </p>
            <small>创建人：@Html.Partial("SysUserDisplay", item.SysUser) 日期：@Html.DisplayFor(a => item.CreatedDate)  回复：@item.KnowledgeReplys.Count()</small>
        </blockquote>
    }
    @Html.Raw(Ajax.MikePager(Model))
</div>
